/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 07 - 02
 * Time: 17:26
 */
class Solution1 {
    public String replaceSpace(String s) {
        return s.replace(" ", "%20");
    }
}

class Solution {
    public String replaceSpace(String s) {
        StringBuilder a = new StringBuilder();
        for(char x: s.toCharArray()) {
            if(x == ' ') {
                a.append("%20");
            }else {
                a.append(x);
            }
        }
        return a.toString();
    }
}
